package com.googlecode.allinclusive.fw.security;

import javax.servlet.http.HttpServletRequest;

import org.springframework.security.web.util.RequestMatcher;

public class MultiRequestMatcher implements RequestMatcher {

	private RequestMatcher[] matchers;
	
	public MultiRequestMatcher(RequestMatcher... matchers) {
		this.matchers = matchers;
	}

	@Override
	public boolean matches(HttpServletRequest request) {
		for (RequestMatcher matcher : matchers) {
			if (!matcher.matches(request)) {
				return false;
			}
		}
		return true;
	}
	
	
}
